home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 16
/
AMIGAplus Sonderheft 16 (1998)(ICP)(DE)[!].iso
/
pd
/
anwendungen
/
rtgmaster_dev
/
demos
/
network
/
tcpclient.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-09-26
|
1KB
|
44 lines
#include <clib/exec_protos.h>
#include <pragmas/exec_pragmas.h>
#include <stdio.h>
#include <strings.h>
#include <clib/rtgextra_protos.h>
#include <pragmas/rtgextra_pragmas.h>
#include <rtgmaster/rtgtcpip.h>
#include <clib/dos_protos.h>
struct Library *SocketBase=0;
struct Library *RTGExtraBase=0;
void makeservaddr(struct sockaddr_in *address, char *host, int port);
struct RTG_Socket *LIBOpenClient(char *host, struct Library *SBase, int port, int mode, int protocol);
struct RTG_Socket rs;
void main()
{
struct RTG_Socket *s;
if (RTGExtraBase=OpenLibrary("rtgextra.library",0))
{
if (SocketBase=OpenLibrary("bsdsocket.library",4))
{
int i;
long mode=1;
char buf[1024];
char buf2[1024];
char *strings[]={"Nur","ein","Test",NULL};
s=OpenClient(SocketBase,"194.55.101.26",3050,SOCK_STREAM,0);
RtgIoctl(SocketBase,s,&mode);
while(1)
{
if (RtgRecv(SocketBase,s,buf,0,25)>0)
printf("%s\n",buf);
sprintf(buf2,"Message from Socket ",s->s);
RtgSend(SocketBase,s,buf2,0,strlen(buf2)+1);
}
CloseLibrary(SocketBase);
CloseLibrary(RTGExtraBase);
}
}
}